package jsyf.oa.dao.system;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import jsyf.oa.entity.system.CompanyStockEntity;
import jsyf.oa.idao.BaseDao;
import jsyf.oa.ientity.IBaseEntity;
import org.springframework.stereotype.Repository;

@Repository
public class CompanyStockDao extends BaseDao {
    public CompanyStockDao() {
        super.iBaseEntity = new CompanyStockEntity();
    }

    @Override
    public IBaseEntity convertJson2Entity(JSONObject json) {
        return JSON.toJavaObject(json, CompanyStockEntity.class);
    }

    public JSONObject getContactAndTelByAddress(String condition,Object[] params) {
        StringBuffer sql=new StringBuffer();
        sql.append(" SELECT ");
        sql.append(" CONTACT as contact,");
        sql.append(" CONTACT_TEL as contactTel");
        sql.append(" FROM t_sys_company_stock WHERE 1=1 ");
        sql.append(condition);
        return super.queryForJsonObject(sql.toString(),params);
    }
}
